home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: netcom.com!bnelson
- From: bnelson@netcom.com (Bob Nelson)
- Subject: Re: why not add getch() to the std C RTL?
- Message-ID: <bnelsonDM887t.LDI@netcom.com>
- Organization: a computer running Linux
- X-Newsreader: TIN [version 1.2 PL2]
- References: <DM85L8.5Jn@emr1.emr.ca>
- Date: Sun, 4 Feb 1996 01:02:17 GMT
- Sender: bnelson@netcom16.netcom.com
-
- On Sun, 4 Feb 1996 00:05:32 GMT, John Grant wrote:
-
- > There are *many* people who want to do the following in their C programs:
- > - read a single unbuffered keystroke (getch() in DOS, ioctl in unix...)
-
- > The usual response is "not standard C, o/s-specific" etc.
-
- I'll just quote the following from "Expert C Programming" by Peter van
- der Linden (ISBN 0-13-177429-8) and offer no comments of my own, other
- than some emphasis added. Instead, it'll be interesting to see how
- participants in comp.lang.c respond to what PvdL thinks (especially in
- the context of your posting). Here's the paragraph from page 213:
-
- "People often wonder why ANSI C didn't define a standard function to
- get a character if a key has been pressed. Without a standard
- function, every system has a different method and program portability
- is lost. The argument against providing kbhit() as part of the
- standard is that *it is mostly useful for GAMES software* and there
- are many other terminal I/O features that are not standardized. In
- addition, you don't want to promise a standard library function *that
- SOME OS's will find difficult to provide.* The argument for providing
- it is that it is mostly useful for games software and that games
- writers don't need the myriad of other terminal I/O features that
- could be standardized. Whichever view you hold, it's true the XJ311
- missed an opportunity to reinforce C as the language of choice for a
- generation of programmers writings games on UNIX."
-
- Comments?
-
- --
- =============================================================================
- Bob Nelson: Dallas, Texas, U.S.A. - bnelson@netcom.com
- Linux for fun, M$ for $$$...and the NFL for what really counts!
- =============================================================================
-
-